function [Result] = fbcca_parameter_select(data,freq,nHarmonics,epochLength,stepTime,Fs)
%FBCCA参数选择
%---input---
%data：数据，size1人，size2刺激频率，size3不同试次，size4通道，size5数据点
%freq：所有刺激频率，单位Hz
%nHarmonics：谐波次数
%stimTime：窗长，单位s
%stepTime：滑窗长度，单位s
%Fs：采样率，单位Hz
%---output---
%Result：正确率，size1表示不同参数，第一列为a，第二列为b，第三列为N，第四列为acc，第五列为var
A = 0.0:0.25:2.0;
B = 0:0.25:1.0;
N = 1:1:9;
[X,Y,Z] = ndgrid(A,B,N);
P = [X(:),Y(:),Z(:)];
nc = size(P,1);
accuracy = zeros(nc,1);
varacc = zeros(nc,1);
parfor i = 1:nc
    a = P(i,1);
    b = P(i,2);
    N = P(i,3);
    [tacc, tvar] = filterbank_canonical_correlation_analysis(data,freq,nHarmonics,epochLength,stepTime,Fs,N,a,b);
    display(['a: ', num2str(a), ' b: ', num2str(b), ' N: ', num2str(N), ' Accuracy: ', num2str(tacc), ' Var: ', num2str(tvar)]);
    accuracy(i) = tacc;
    varacc(i) = tvar;
end
Result = cat(2,P,accuracy,varacc);
end

